/**
 * @file settings about service interface. Modify to fit your project
 */

export interface FieldConfig {
  codeField?: string;
  msgField?: string;
  resultField?: string;
  listField?: string;
  totalField?: string;
  trailingTimeField?: string;
  // custom ${headers} for token
  tokenField?: string;
}

export const baseFieldConfig: Required<FieldConfig> = {
  codeField: "code",
  msgField: "message",
  resultField: "result",
  listField: "list",
  totalField: "total",
  trailingTimeField: "_t",
  tokenField: "Authorization",
};

// OK, maybe one ResponseOKCode boolean is enough here.
export interface ResponseCodeConfig {
  // OK is required and usually to be 0, which represent meaningful response
  OK: number;
  [key: string]: number;
}

export const baseResponseCodeConfig: ResponseCodeConfig = {
  OK: 0,
  Error: 10,
};
